package VN.EDU.IMIC.DEVELOPER.DOMINHNGOC;

public class Array01model {
	public double trungbinh(double[] arr){
		double sum = 0;
		for (int i = 0; i < arr.length; i++) {
			sum +=arr[i];
		}
		return sum/arr.length;
	}
	
	public int trenTrungBinh(double[] arr, double tb ){
		int so=0;
		for (int i = 0; i < arr.length; i++) {
			if (arr[i]>tb) {
				so++;
			}
		}
		return so;
	}
	
	public int duoiTrungBinh(double[] arr, double tb ){
		int so=0;
		for (int i = 0; i < arr.length; i++) {
			if (arr[i]<tb) {
				so++;
			}
		}
		return so;
	}
	
}
